//
//  StoreInformationOneHearderView.m
//  GLGW_Shoping
//
//  Created by whx on 2018/12/10.
//  Copyright © 2018年 yang. All rights reserved.
//

#import "StoreInformationOneHearderView.h"

@implementation StoreInformationOneHearderView
{
    GLGWLabel *leftLab;
}

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        self.contentView.backgroundColor = [UIColor whiteColor];
        
        GLGWView *lineView = [[GLGWView alloc] initWithInSuperView:self.contentView];
        lineView.backgroundColor = [UIColor colorWithHexString:@"#EAEAEA"];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).offset(kHeightProportion_In_iPhoneTriploid(0));
            make.left.equalTo(self.contentView).offset(kHeightProportion_In_iPhoneTriploid(15));
            make.right.equalTo(self.contentView).offset(-kHeightProportion_In_iPhoneTriploid(15)).priorityMedium();
            make.height.equalTo(@(1));
        }];
        
        GLGWLabel *lab = [[GLGWLabel alloc] initWithFont:SYSTEMFONT(16) theColor:kColor_Rule_Black inSuperView:self.contentView];
        lab.text = @"店铺优势";
        [lab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(lineView.mas_left);
            make.top.equalTo(lineView.mas_bottom).offset(kHeightProportion_In_iPhoneTriploid(21));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(22)));
        }];
        leftLab = lab;
        
        GLGWButton *btn = [[GLGWButton alloc] initWithTitle:@"" titleLableFont:SYSTEMFONT(12) titleLableColor:[UIColor colorWithHexString:@"#A89A60"] inSuperView:self.contentView];
        [btn setImage:[UIImage imageNamed:@"button_tianjia"] forState:UIControlStateNormal];
        [btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(lineView.mas_right);
            make.centerY.equalTo(lab.mas_centerY);
            make.width.equalTo(@(kWidthProportion_In_iPhoneTriploid(73)));
            make.height.equalTo(@(kHeightProportion_In_iPhoneTriploid(22)));
        }];
        [btn setBackgroundColor:[UIColor colorWithHexString:@"#F8F7F3"]];
        btn.layer.masksToBounds = YES;
        btn.layer.cornerRadius = kWidthProportion_In_iPhoneTriploid(11);
        [btn addTarget:self action:@selector(btnAction:) forControlEvents:UIControlEventTouchUpInside];
     }
    return self;
}

- (void)btnAction:(GLGWButton *)sender
{
    if (self.BlockBtn) {
        self.BlockBtn(sender);
    }
}

- (void)setLeftStr:(NSString *)leftStr
{
    _leftStr = leftStr;
    leftLab.text = leftStr;
}

@end
